<template>
	<view class="content">
		<headerbox :cixitype="cixi"></headerbox>
		<view class="pages">
			<view class="card">
				<view class="card-body">
					<view class="btns" @click="gokefu()">点击聊天</view>
				</view>
			</view>
		</view>
		<view class="footer-bar" :class="cixi ? '':'footer-bar-detached'">
			<view class="fbitem" @click="goSwichPage('/pages/index/index')">
				<view class="image">
					<image src="../../static/timg/shouye.png" mode=""></image>
				</view>
				<view class="text">首页</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/contract/contract')">
				<view class="image">
					<image src="../../static/timg/heyue.png" mode=""></image>
				</view>
				<view class="text">合约</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/user/assets')">
				<view class="image">
					<image src="../../static/timg/zichan.png" mode=""></image>
				</view>
				<view class="text">资产</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/user/claim')">
				<view class="image">
					<image src="../../static/timg/suopei.png" mode=""></image>
				</view>
				<view class="text">索赔</view>
			</view>
		</view>
	</view>
</template>

<script>
	import headerbox from '@/pages/header.vue'
	import { sysconfig } from '../../api/api.js'
	export default{
		components:{
			headerbox
		},
		data(){
			return{
				cixi:false,
				
				setting:[]
			}
		},
		onPageScroll(e) {
			if(e.scrollTop > 0){
				this.cixi = true
			}else{
				this.cixi = false
			}
		},
		onLoad() {
			this.getsysconfig()
		},
		methods:{
			getsysconfig(){
				let datas = {
					type:1
				}
				sysconfig(datas).then(res => {
					if(res.data.status.errorCode == 0){
						this.setting = res.data.data
					}
				}).catch(err => {
					console.log(err)
				})
			},
			gokefu(){
				window.open(this.setting.service_link)
			},
			goSwichPage(page){
				uni.navigateTo({
					url:page
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	*{
		box-sizing: border-box;
	}
	.content{
		width: 100%;
		min-height: 100vh;
		background-color: #f1f1f7;
		color: #747474 !important;
	}
	.pages{
		padding-top: calc(calc(110rpx + 60rpx) + env(safe-area-inset-top));
		padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
	}
	.card{
		width: 94%;
		margin: 0 auto;
		border-radius: 20rpx;
		position: relative;
		display: flex;
		flex-direction: column;
		word-wrap: break-word;
		margin-bottom: 30rpx;
		background-color: #fff;
		box-shadow: rgba(0, 0, 0, .35) 0px 30px 60px -30px, rgba(0, 0, 0, .35) 0px -2px 6px 0px inset;
	}
	.card-body{
		z-index: 3;
		flex: 1 1 auto;
		padding: 40rpx;
	}
	.btns{
		width: 176rpx;
		height: 100rpx;
		text-align: center;
		line-height: 92rpx;
		border-radius: 24rpx;
		font-size: 24rpx;
		font-weight: 700;
		box-shadow: 0 5px 14px 0 rgba(0, 0, 0, 0.1);
	    background-color: #FFCE54 !important;
	    color: #FFF !important;
		border-bottom: 8rpx solid #F6BB42;
		margin: 0 auto;
	}
	
	.footer-bar{
		background-color: rgba(255, 255, 255, 0.95);
		padding: 0px 20rpx;
		position: fixed;
		bottom: 0px;
		left: 0px;
		right: 0px;
		z-index: 98;
		backdrop-filter: blur(20rpx);
		display: flex;
		text-align: center;
		transition: all 250ms ease;
		height: calc(120rpx + env(safe-area-inset-bottom));
		box-shadow: 0 -10rpx 10rpx 0 rgba(0, 0, 0, 0.04);
	}
	.footer-bar.footer-bar-detached{
		border-radius: 40rpx;
		left: 20rpx !important;
		right: 20rpx !important;
		bottom: 30rpx !important;
		box-shadow: 0 0px 30rpx 0 rgba(0, 0, 0, 0.1) !important;
		height: 120rpx !important;
	}
	.fbitem{
		color: #818181;
		position: relative;
		flex: 1 1 auto;
		padding-top: 24rpx;
		
		.image{
			height: 48rpx;
			margin-top: -4rpx;
			
			image{
				width: 36rpx;
				height: 36rpx;
			}
		}
		.text{
			height: 48rpx;
			margin-top: -6rpx;
			font-size: 24rpx;
			opacity: 0.7;
			color: #818181;
		}
	}
</style>